home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-02-23 | 2.8 KB | 122 lines | [TEXT/MSCT] |
- //
- // Document Dependencies.M1S: Show dependencies for documents & images
- // This script shows a list of all images and documents in a job and which
- // images they depend on (by linking). If a linked image gets a '*' in the left-hand
- // column it means that this image is structured itself and depends on other images.
- //
- // Example:
- //
- // doc1, doc2: QXPress docs that use an image DCS1
- // DCS1: DCS 1.0 image that uses plate files DCS1.C, DCS1.M,DCS1.Y,DCS1.K
- // When dragging a folder with these files onto this script, you get this:
- //
- //doc1
- //* DCS1
- // DCS1.C
- // DCS1.K
- // DCS1.M
- // DCS1.Y
- //doc2
- //* DCS1
- // DCS1.C
- // DCS1.K
- // DCS1.M
- // DCS1.Y
- //DCS1
- // DCS1.C
- // DCS1.K
- // DCS1.M
- // DCS1.Y
- //---------------------------------------
- //
- // This tells you that doc1 needs files DCS1, DCS1.C,... DCS1.Y. The '*' in front
- // of DCS1 below doc1 tells you that DCS1 is a structured image itself; at the
- // end we find DCS1, which needs files DCS1.C,...DCS1.Y.
- //
-
- //
- // *************************************
- // Constants
- // *************************************
- //
- cIndent = " "
- cMaxLevel = 5
-
- //
- // *************************************
- // Procedures
- // *************************************
- //
- proc AddDocumentToList
- docCount = docCount + 1
- docTable[docCount] = it
- docNameTable[it.code] = docCount
- docUsage[docCount,0] = 0
- docLevel[docCount] = 0
- end proc
-
- proc PrintLevelString
- i_Level = 1
- while i_Level < printLevel
- print cIndent;
- i_Level = i_Level + 1
- wend
- print printString
- end proc
-
- //
- // Remember that document 'it' is used by document 'docTable[docNum]'
- //
- proc MarkSubDocument
- subDocNum = docNameTable[it.code]
- if subDocNum <> docNum then
- docUsage[docNum,0] = docUsage[docNum,0] + 1
- docUsage[docNum,docUsage[docNum,0]] = subDocNum
- end if
- end proc
-
- //
- // *************************************
- // end Procedures
- // *************************************
- //
-
- //
- // Main
- //
-
- theJob = it
- docCount = 0
- on file do AddDocumentToList
- on job do AddDocumentToList
- scan theJob links uses, contains, overlaps, defines
- scan reset
-
- on file do MarkSubDocument
- on job do MarkSubDocument
- docNum = 1
- while docNum <= docCount
- scan docTable[docNum] links uses, contains, overlaps, defines
- docNum = docNum + 1
- wend
- scan reset
-
- docNum = 1
- while docNum <= docCount
- if docNum = 1 or docUsage[docNum,0] > 0 then
- print docTable[docNum].name
- docPos = 1
- while docPos <= docUsage[docNum,0]
- subDocNum = docUsage[docNum,docPos]
- if docUsage[subDocNum,0] > 0 then
- print "*" + cIndent + docTable[subDocNum].name
- else
- print " " + cIndent + docTable[subDocNum].name
- end if
- docPos = docPos + 1
- wend
- end if
- docNum = docNum + 1
- wend
- print "---------------------------------------"
-